//
//  RestPwdApi.m
//  DTSTON
//
//  Created by 喻贵华 on 15/12/15.
//  Copyright © 2015年 Demo. All rights reserved.
//

#import "RestPwdApi.h"

@implementation RestPwdApi
{
    NSString *_username;
    NSString *_password;
    NSString *_code;
    
}

- (id)initWithUsername:(NSString *)username password:(NSString *)password code:(NSString *)code {
    self = [super init];
    if (self) {
        _username = username;
        _password = password;
        _code=code;
    }
    return self;
}

- (NSString *)requestUrl {
    return @"/new/user/reset_pwd";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
       
    
    NSMutableDictionary *dic = [NSMutableDictionary getPubdicGuest];
    if (_username) {
        
        NSString* base64Text = [NSString encryptUseAES:_username key:nil];
        
        [dic setObject:base64Text forKey:@"username"];
        
    }
    if (_password) {
        NSString* base64Text = [NSString encryptUseAES:_password key:nil];
        
        [dic setObject:base64Text forKey:@"password"];
        
    }
    if (_code) {
        [dic setObject:_code forKey:@"vcode"];
        
    }
    NSString *sign=[NSString getSign:dic];
    [dic setObject:sign forKey:@"sign"];
    return dic;
    

   
}



- (NSString *)userId {
    return [[[self responseJSONObject] objectForKey:@"userId"] stringValue];
}
-(void)analyResponSerializer

{
    
    
    
}
@end
